<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Read the header of the message</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.imap-header.html">« imap_header</a></li>
      <li style="float: right;"><a href="function.imap-headers.html">imap_headers »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.imap.html">IMAP 函数</a></li>
    <li>Read the header of the message</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.imap-headerinfo" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imap_headerinfo</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">imap_headerinfo</span> &mdash; <span class="dc-title">Read the header of the message</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.imap-headerinfo-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imap_headerinfo</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><span class="type IMAP\Connection">IMAP\Connection</span></span> <code class="parameter">$imap</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$message_num</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$from_length</code><span class="initializer"> = 0</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$subject_length</code><span class="initializer"> = 0</span></span><br>): <span class="type"><span class="type"><a href="class.stdclass.html" class="type stdClass">stdClass</a></span>|<span class="type"><span class="type false">false</span></span></span></div>

  <p class="para rdfs-comment">
   Gets information about the given message number by reading its headers.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.imap-headerinfo-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    <dt>

<code class="parameter">imap</code></dt>
<dd>
<p class="para"><span class="classname"><strong class="classname">IMAP\Connection</strong></span> 实例。</p></dd>

    
     <dt>
<code class="parameter">message_num</code></dt>

     <dd>

      <p class="para">
       The message number
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">from_length</code></dt>

     <dd>

      <p class="para">
       Number of characters for the <code class="literal">fetchfrom</code> property.
       Must be greater than or equal to zero.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">subject_length</code></dt>

     <dd>

      <p class="para">
       Number of characters for the <code class="literal">fetchsubject</code> property
       Must be greater than or equal to zero.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">defaulthost</code></dt>

     <dd>

      <p class="para">
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.imap-headerinfo-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns <strong><code>false</code></strong> on error or, if successful, the information in an object with following properties:
   <ul class="itemizedlist">
    <li class="listitem">
     <span class="simpara">
      toaddress - full to: line, up to 1024 characters
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      to - an array of objects from the To: line, with the following 
      properties: <code class="literal">personal</code>, <code class="literal">adl</code>,
      <code class="literal">mailbox</code>, and <code class="literal">host</code>
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      fromaddress - full from: line, up to 1024 characters
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      from - an array of objects from the From: line, with the following 
      properties: <code class="literal">personal</code>, <code class="literal">adl</code>,
      <code class="literal">mailbox</code>, and <code class="literal">host</code>
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      ccaddress - full cc: line, up to 1024 characters
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      cc - an array of objects from the Cc: line, with the following 
      properties: <code class="literal">personal</code>, <code class="literal">adl</code>,
      <code class="literal">mailbox</code>, and <code class="literal">host</code>
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      bccaddress - full bcc: line, up to 1024 characters
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      bcc - an array of objects from the Bcc: line, with the following 
      properties: <code class="literal">personal</code>, <code class="literal">adl</code>,
      <code class="literal">mailbox</code>, and <code class="literal">host</code>
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      reply_toaddress - full Reply-To: line, up to 1024 characters
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      reply_to - an array of objects from the Reply-To: line, with the following
      properties: <code class="literal">personal</code>, <code class="literal">adl</code>,
      <code class="literal">mailbox</code>, and <code class="literal">host</code>
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      senderaddress - full sender: line, up to 1024 characters
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      sender - an array of objects from the Sender: line, with the following 
      properties: <code class="literal">personal</code>, <code class="literal">adl</code>,
      <code class="literal">mailbox</code>, and <code class="literal">host</code>
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      return_pathaddress - full Return-Path: line, up to 1024 characters
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      return_path - an array of objects from the Return-Path: line, with the
      following properties: <code class="literal">personal</code>, 
      <code class="literal">adl</code>, <code class="literal">mailbox</code>, and 
      <code class="literal">host</code>
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      remail - 
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      date - The message date as found in its headers
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      Date - Same as date
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      subject - The message subject
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      Subject - Same as subject 
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      in_reply_to - 
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      message_id - 
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      newsgroups - 
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      followup_to - 
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      references - 
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      Recent - <code class="literal">R</code> if recent and seen, <code class="literal">N</code>
      if recent and not seen, &#039; &#039; if not recent.
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      Unseen - <code class="literal">U</code> if not seen AND not recent, &#039; &#039; if seen
      OR not seen and recent
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      Flagged - <code class="literal">F</code> if flagged, &#039; &#039; if not flagged
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      Answered - <code class="literal">A</code> if answered, &#039; &#039; if unanswered
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      Deleted - <code class="literal">D</code> if deleted, &#039; &#039; if not deleted
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      Draft - <code class="literal">X</code> if draft, &#039; &#039; if not draft
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      Msgno - The message number
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      MailDate - 
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      Size - The message size
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      udate - mail message date in Unix time
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      fetchfrom - from line formatted to fit <code class="parameter">from_length</code>
      characters
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      fetchsubject - subject line formatted to fit 
      <code class="parameter">subject_length</code> characters
     </span>
    </li>
   </ul>
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.imap-headerinfo-changelog">
  <h3 class="title">更新日志</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>版本</th>
      <th>说明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.1.0</td>
 <td>
  现在 <code class="parameter">imap</code> 参数接受 <span class="classname"><strong class="classname">IMAP\Connection</strong></span>
  实例，之前接受 <a href="language.types.resource.html" class="link">资源(resource)</a>。
 </td>
</tr>

     <tr>
      <td>8.0.0</td>
      <td>
       The unused <code class="parameter">defaulthost</code> parameter has been removed.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.imap-headerinfo-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.imap-fetch-overview.html" class="function" rel="rdfs-seeAlso">imap_fetch_overview()</a> - Read an overview of the information in the headers of the given message</span></li>
   </ul>
  </p>
 </div>

</div></div></div></body></html>